// 2023/4/12

class ClassWithPrivate {
  publicFieldWithInitializer = 13;

  publicMethod() {
    console.log(this.publicFieldWithInitializer);
  }

  #privateField;
  #privateFieldWithInitializer = 42;

  #privateMethod() {
    console.log(this.#privateFieldWithInitializer);
  }

  static #privateStaticField;
  static #privateStaticFieldWithInitializer = 42;

  static #privateStaticMethod() {
    // …
  }
}

function run() {
  const obj = new ClassWithPrivate();

  console.log(obj.publicFieldWithInitializer);
}

run();



